package com.people.netmon.reddit.probe.controller;

import ai.people.netmon.framework.domain.reddit.probe.entity.RedditAccount;
import ai.people.netmon.framework.model.response.Result;
import ai.people.netmon.framework.utils.ResultUtil;
import com.people.netmon.reddit.probe.service.RedditAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 探测账号控制器
 *
 * @author yuanqinglong
 * @date 2022/3/11 15:49
 */
@RestController
@RequestMapping("/probe/user")
public class RedditAccountController {

    @Autowired
    RedditAccountService service;


    /**
     * 批量保存reddit账号信息
     *
     * @param list facebook账号信息集合
     * @return {@link Result}<{@link Boolean}>
     */
    @PostMapping("/batchSave")
    Result<Boolean> saveBatch(@RequestBody List<RedditAccount> list){
        service.saveBatchData(list);
        return ResultUtil.success();
    }

}
